using System.Web.Mvc;
using Microsoft.Practices.Unity;
using Unity.Mvc4;
using TNPTN.Services;

namespace TNPTN
{
    /// <summary>
    /// Bootstrapper
    /// Author: jabraok
    /// </summary>
    public static class Bootstrapper
    {
        /// <summary>
        /// Initialise
        /// </summary>
        /// <returns>IUnityContainer</returns>
        public static IUnityContainer Initialise()
        {
            var container = BuildUnityContainer();
            DependencyResolver.SetResolver(new UnityDependencyResolver(container));
            return container;
        }

        /// <summary>
        /// Build Unity Container
        /// </summary>
        /// <returns></returns>
        private static IUnityContainer BuildUnityContainer()
        {
            var container = new UnityContainer();

            //// register all your components with the container here
            //// it is NOT necessary to register your controllers
            //container.RegisterType<TDownloadService, TDownloadService>();

            RegisterTypes(container);
            return container;
        }

        /// <summary>
        /// RegisterTypes
        /// </summary>
        /// <param name="container">IUnityContainer</param>
        public static void RegisterTypes(IUnityContainer container)
        {

        }
    }
}